package com.xyht.sca_s.student_manage_system.modules.enrollmentManagement.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.enrollmentManagement.service.SmsEnrollmentManagementStudentDataStatisticsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * <p>
 * 招生管理学生信息 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2024-01-15
 */
@RestController
@RequestMapping("/enrollment/student")
@SecretBody
public class SmsEnrollmentManagementStudentDataStatisticsController {

    @Resource
    private SmsEnrollmentManagementStudentDataStatisticsService studentDataStatisticsService;


    @ApiOperation(value = "专业数据统计")
    @GetMapping("/majorDataStatistics")
    public ResponseResult getMajorDataStatistics(@RequestParam(value = "taskId") String taskId,
                                                 @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                 @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                 @RequestParam(value = "collegeId", required = false) String collegeId,
                                                 @RequestParam(value = "majorId", required = false) String majorId){
        return studentDataStatisticsService.getMajorDataStatistics(taskId,collegeId,majorId,pageNum,pageSize);
    }

    @ApiOperation(value = "省份数据统计")
    @GetMapping("/provincesDataStatistics")
    public ResponseResult getProvincesDataStatistics(@RequestParam(value = "taskId",required = false) String taskId,
                                                     @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                     @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                     @RequestParam(value = "collegeId", required = false) String collegeId,
                                                     @RequestParam(value = "majorId", required = false) String majorId,
                                                     @RequestParam(value = "provinces", required = false) String provinces) {
        return studentDataStatisticsService.getProvincesDataStatistics(taskId,collegeId,majorId,provinces,pageNum,pageSize);
    }

    @ApiOperation(value = "男女数据统计")
    @GetMapping("/sexDataStatistics")
    public ResponseResult getSexDataStatistics(@RequestParam(value = "taskId",required = false) String taskId,
                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                               @RequestParam(value = "collegeId", required = false) String collegeId,
                                               @RequestParam(value = "majorId", required = false) String majorId,
                                               @RequestParam(value = "sex", required = false) String sex){
        return studentDataStatisticsService.getSexDataStatistics(taskId,collegeId,majorId,sex,pageNum,pageSize);
    }

    @ApiOperation(value = "大数据人数统计页面")
    @GetMapping("/bigDataPeopleStatistics")
    public ResponseResult getBigDataPeopleStatistics(@RequestParam(value = "taskId",required = false) String taskId){
        return studentDataStatisticsService.getBigDataPeopleStatistics(taskId);
    }

    @ApiOperation(value = "大数据院系招生率页面")
    @GetMapping("/bigDataCollegeStatistics")
    public ResponseResult getBigDataCollegeStatistics(@RequestParam(value = "taskId",required = false) String taskId,
                                                      @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                      @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
        return studentDataStatisticsService.getBigDataCollegeStatistics(taskId, pageNum, pageSize);
    }

    @ApiOperation(value = "大数据省份分布率页面")
    @GetMapping("/bigDataProvincesStatistics")
    public ResponseResult getBigDataProvincesStatistics(@RequestParam(value = "taskId",required = false) String taskId,
                                                        @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                        @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
        return studentDataStatisticsService.getBigDataProvincesStatistics(taskId,pageNum,pageSize);
    }


}

